<extend name="Public/main" />

<block name="body">
	<div class="wrap J_check_wrap">
		<div class="nav">
			<ul class="cc">
				<li class="current"><a href="{:U('slide/index')}">所有幻灯片</a></li>
				<li ><a href="{:U('slide/add')}" >添加幻灯片</a></li>
			</ul>
		</div>
		<form method="post" id="cid_form"> 
			<div class="search_type cc mb10">
				<div class="mb10"> 
					<select class="select_2" name="cid"style="width:100px;" id="selected_cid">
						<option value=''>全部</option>
						<foreach name="categorys" item="vo">
							<php>$cid_select=$vo['cid']===$slide_cid?"selected":"";</php>
							<option value="{$vo.cid}" {$cid_select}>{$vo.cat_name}</option>
						</foreach>
					</select>
				</div>
			</div>
		</form>
		<form class="J_ajaxForm" action="" method="post">
			<div class="table_list">
				<table width="100%">
					<colgroup>
						<col width="36">
						<col width="40">
						<col width="80">
						<col width="80">
						<col width="80">
						<col width="90">
						<col width="140">
						<col width="120">
					</colgroup>
					<thead>
						<tr>
							<td><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></td>
							<td>排序</td>
							<td>ID</td>
							<td>标题</td>
							<td>描述</td>
							<td>操作</td>
						</tr>
					</thead>
					<foreach name="slides" item="vo">
						<tr>
							<td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.slide_id}"></td>
							<td><input name='listorders[{$vo.slide_id}]' class="input mr5"  type='text' size='3' value='{$vo.listorder}'></td>
							<td>{$vo.slide_id}</td>
							<td>{$vo.slide_name}</td>
							<td>{$vo.slide_des}dd</td>
							<td>
								<a href="{:U('slide/edit',array('id'=>$vo[slide_id]))}">修改</a>|
								<a href="{:U('slide/delete',array('id'=>$vo[slide_id]))}" class="J_ajax_del" >删除</a>
							</td>
						</tr>
					</foreach>
				</table>
				<div class="p10"><div class="pages">  </div> </div>

			</div>
			<div>
				<div class="btn_wrap_pd">
					<label class="mr20"><input type="checkbox" class="J_check_all" data-direction="y" data-checklist="J_check_y">全选</label>  
					<button class="btn J_ajax_submit_btn" type="submit" data-action="{:u('slide/listorders')}">排序</button>              
					<button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('slide/delete')}">删除</button>
				</div>
			</div>
		</form>
	</div>
</block>
<block name="script">
	<script>
		setCookie('refersh_time', 0);
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location.reload();
			}
		}
		setInterval(function() {
			refersh_window()
		}, 3000);
		$(function() {
			$("#selected_cid").change(function() {
				$("#cid_form").submit();
			});
		});

	</script>
</block>
